package com.evaluation.kexingcp.psycho.evaluation.sys.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.evaluation.kexingcp.common.security.service.KexingcpUser;
import com.evaluation.kexingcp.common.security.util.SecurityUtils;
import com.evaluation.kexingcp.psycho.evaluation.sys.controller.vo.EvaluationReportVo;
import com.evaluation.kexingcp.psycho.evaluation.sys.controller.vo.EvaluationTaskUserVo;
import com.evaluation.kexingcp.psycho.evaluation.sys.controller.vo.UserReportStatusVo;
import com.evaluation.kexingcp.psycho.evaluation.sys.controller.vo.UserReportVo;
import com.evaluation.kexingcp.psycho.evaluation.sys.entity.EvaluationTaskUserRelEntity;
import com.evaluation.kexingcp.psycho.evaluation.sys.mapper.EvaluationTaskUserRelMapper;
import com.evaluation.kexingcp.psycho.evaluation.sys.service.EvaluationTaskUserRelService;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 任务用户关联表
 *
 * @author pig
 * @date 2024-07-12 15:58:31
 */
@Service
public class EvaluationTaskUserRelServiceImpl extends ServiceImpl<EvaluationTaskUserRelMapper, EvaluationTaskUserRelEntity> implements EvaluationTaskUserRelService {
    @Override
    public IPage getMyTask(Page page, EvaluationTaskUserRelEntity entity) {
        return baseMapper.selectMyTask(page, SecurityUtils.getUser().getId(), entity);
    }

    @Override
    public List<EvaluationTaskUserVo> getMyUncompleteTask() {
        return baseMapper.selectMyUncompleteTask(SecurityUtils.getUser().getId());
    }

    @Override
    public int getTaskUserCount(Long taskId) {
        return baseMapper.selectTaskUserCount(taskId);
    }

    @Override
    public String getTaskScales(Long taskId) {
        return baseMapper.selectScales(taskId);
    }

    @Override
    public int getTaskUserCompletedCount(Long taskId) {
        return baseMapper.selectTaskUserCompletedCount(taskId);
    }


    @Override
    public List<UserReportVo> getTaskUsers(Long taskId) {
        return baseMapper.selectTaskUsers(taskId);
    }

    @Override
    public List<UserReportStatusVo> getUserCompleteStatus(Long taskId) {
        return baseMapper.selectUserCompleteStatus(taskId);
    }

    @Override
    public List<Map> getTaskCompleteDate(Long taskId) {
        return baseMapper.selectTaskCompeleteDate(taskId);
    }

    @Override
    public List<EvaluationReportVo> getTaskUserList(Long taskId) {
        return baseMapper.selectReportVo(taskId);
    }
}